package com.feishi.core.util.queue.disruptor;

import com.feishi.core.util.queue.Customer;
import com.lmax.disruptor.EventHandler;

/**
 * Created by caixq on 4/25 025.
 */
public  class CustomerImpl<T> implements EventHandler<DisruptorData> {

    private Customer customer;

    @Override
    public void onEvent(DisruptorData event, long sequence, boolean endOfBatch) throws Exception {
        customer.execute(event.getValue(),sequence,endOfBatch);
    }

    public CustomerImpl(Customer customer) {
        this.customer=customer;
    }
}
